import sheep from '@/sheep';
import {
  formatImageUrlProtocol
} from './index';

import third from '@/sheep/api/migration/third.js'

const user = (poster) => {
  const width = poster.width;
  const userInfo = sheep.$store('user').userInfo;

  return {
    background: sheep.$store('app').platform.share.posterInfo.user_bg,
    list: [{
        name: 'nickname',
        type: 'text',
        val: userInfo.nickname,
        x: width / 4,
        y: width * 1.65,
        paintbrushProps: {
          textAlign: 'center',
          fillStyle: '#333',
          font: {
            fontSize: 14,
            fontFamily: 'sans-serif',
          },
        },
      },
      {
        name: 'avatar',
        type: 'image',
        val: userInfo.avatar.replace('http://', 'https://'),
        x: width / 6.5,
        y: width * 1.4,
        width: width * 0.2,
        height: width * 0.2,
        d: width * 0.2,
      },
      // #ifndef MP-WEIXIN
      {
        name: 'qrcode',
        type: 'qrcode',
        val: poster.shareInfo.link,
        x: width * 0.35,
        y: width * 0.84,
        size: width * 0.3,
      },
      // #endif
      // #ifdef MP-WEIXIN
      {
        name: 'wxacode',
        type: 'image',
        val: 'http://baiyihui.top/images/app/brokerage/promotion/2024/3/30/',
        // val: "http://baiyihui.top/d81ff8167b59ca575db1732b45430d927cc3fe767143adc68c87a633768c3409.jpg",
        x: width / 1.75,
        y: width * 1.35,
        width: width * 0.35,
        height: width * 0.35,
        mode: 'widthFix',
        zIndex: 2,
      },
      // #endif
    ],
  };
};

export default user;